package com.example.test.dialogfactory;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import androidx.appcompat.app.AppCompatActivity;
import easier.app.x.drawable.progress.load.DotPushDrawable;

public class MainActivity49 extends AppCompatActivity {

    private View mView;
    private SeekBar mSeek;

    public static void start( Context context ) {

        Intent starter = new Intent( context, MainActivity49.class );
        context.startActivity( starter );
    }

    @Override
    protected void onCreate( Bundle savedInstanceState ) {

        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main49 );
        initView();
    }

    private void initView() {

        mView = (View) findViewById( R.id.view );
        DotPushDrawable background = new DotPushDrawable();
        mView.setBackground( background );
        mSeek = (SeekBar) findViewById( R.id.seek );

        mSeek.setOnSeekBarChangeListener( new OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged( SeekBar seekBar, int i, boolean b ) {

                float max = seekBar.getMax() * 1f;
                background.setProgress( i / max );
            }

            @Override
            public void onStartTrackingTouch( SeekBar seekBar ) {

            }

            @Override
            public void onStopTrackingTouch( SeekBar seekBar ) {

            }
        } );
    }
}